<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>点击</title>
</head>
<body>
	<form id="form_id" action="http://www.baidu.com">
		账号:<input id="username" name="username" type="text"><br>
		密码:<input name="password"  type="text"><br>
		<input type="submit" value="登录">
	</form>
</body>
<script src="../js/jquery.min.js"></script>
<script>
   $(document).ready(()=>{
	   $("#form_id").submit((e)=>{
		   let username = $("#username").val();
		   if(username=="root"){
			   console.log("登录成功");
			   return true;
		   }else{
			   console.log("登录失败:"+JSON.stringify(e));
			   return false;
		   }
	   });
   });
</script>
</html>
